Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix insufficient flushing on ARMv8.2+ #5257

Merged
merged 1 commit into from
Jul 2, 2021
Merged

Conversation

kilobyte
Copy link
Contributor

@kilobyte kilobyte commented Jun 24, 2021

You need to use Point-of-Persistency flushes, defined specifically for our use case. This instruction has been split so Point-of-Coherency could be made lighter.

The documentation is clear here, and it's an obvious data loss bug, but no one of us had access to an ARMv8.2 machine to test before. No help has been offered by ARM (in stark contrast to IBM with ppc) thus there's no official support for PMDK on arm64 — but not flushing is severe enough to be fixed even in experimental code.


This change is Reviewable

ARMv8.2 separates flush-for-coherency from flush-for-persistency as two
instructions: DC CVAC and DC CVAP.  It's the latter that is of interest
to us, and it is up to the processor to know where the Point of
Persistency happens to be.

The documentation is very clear, and this PIRL talk dispels all doubt:
https://www.youtube.com/watch?v=8QAuN8CL5Zg

On the other hand, I found no clear answer whether DC CVAC might be
enough on some pre-8.2 hardware.  There's no other option though (CVAC
is the heaviest flush available).  This question is probably moot as
pre-8.2 CPUs, while ubiquitous in dev boards, are gone in datacenter
gear.
@codecov
Copy link

codecov bot commented Jun 24, 2021

Codecov Report

Merging #5257 (ffbe4d9) into master (2c68fd4) will decrease coverage by 0.03%.
The diff coverage is n/a.

@@            Coverage Diff             @@
##           master    #5257      +/-   ##
==========================================
- Coverage   72.95%   72.91%   -0.04%     
==========================================
  Files         187      187              
  Lines       29154    29129      -25     
==========================================
- Hits        21269    21240      -29     
- Misses       7885     7889       +4     

@@ -38,10 +71,15 @@ pmem2_arch_init(struct pmem2_arch_info *info)
LOG(3, NULL);

info->fence = memory_barrier;
info->flush = flush_dcache;
if (is_dc_pop_available())
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In the future, this should also include a check for ARM's eADR equivalent. But for now, it's fine.

@pbalcer pbalcer merged commit cee8d13 into pmem:master Jul 2, 2021
@kilobyte kilobyte deleted the arm64-cvap branch July 2, 2021 19:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants